package com.fwx.java2025420.ioc_car;

public class BulidNewCar {
    public static void main(String[] args) {
        Tire tire = new Tire(20,"yellor");
        Bottom bottom = new Bottom(tire);
        Framework framework = new Framework(bottom);
        Car car = new Car(framework);
        System.out.println("car bulid completion");
    }
}
//车类
class Car{
    public Car(Framework framework) {
        System.out.println("car init...");
    }
}
//车身类
class Framework{
    public Framework(Bottom bottom){
        System.out.println("Framework init...");
    }
}
//底盘类
class Bottom{
    public Bottom(Tire tire){
        System.out.println("bottom init...");
    }
}
//轮胎类
class Tire{
    public Tire(int size, String color){
        System.out.println("Tire size"+size+" Tire color"+color);
    }
}
